/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$("#checkall").click(function(){
    if($('#checkall').is(':checked')){
        $("input[name='option']:checkbox").prop("checked", true);
    }else{
        $("input[name='option']:checkbox").prop("checked", false);
    }
});

function getcheckids(){
    var ids = [];
    $("input[name='option']:checked").each(function(){   
        ids.push($(this).data("id"));    
    });  
    var delIds=ids.join(",");   
    //console.log(delIds);
    return delIds;
}


//时间戳转日期
function timestampToTime(timestamp,status) {
    var date = new Date(timestamp * 1000);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
    Y = date.getFullYear();
    M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1);
    D = date.getDate();
    h = date.getHours();
    m = date.getMinutes();
    s = date.getSeconds();
    if (status == 1) {//自定义返回格式 2018-01-01
        return Y+'-'+M+'-'+D;
    }else{//返回格式 2018-01-01 12:12:12
        return Y+'-'+M+'-'+D+' '+h+':'+m+':'+s;
    }
    
    
    
}